#ifndef BLE_RECEIVE_TASK_H
#define BLE_RECEIVE_TASK_H

#include <stdint.h>

#define SLAVE_NUM_MAX    8

typedef enum
{
	RESTORED        = 0,    //已恢复出厂设置
	RESTORING       = 1,    //正在恢复出厂设置
	RESTORE_TIMEOUT = 2,    //恢复出厂设置超时
    NOT_PAIR        = 3,    //未配对
	PAIRED          = 4,    //与从机已配对，未连接
	CONNECT_TIMEOUT = 5,    //连接超时
	CONNECTING      = 6,    //连接中
	CONNECTED       = 7,    //已连接

} ble_state_e;

typedef enum
{
    OFF_LINE = 0,
    ON_LINE = 1,

} ble_slave_state_e;

typedef struct 
{
    uint8_t ble_slave_state_last;
    uint8_t ble_slave_state;

    uint8_t ble_slave_relay_state_last;
    uint8_t ble_slave_relay_state;

    uint8_t ble_slave_time;
    uint8_t ble_slave_id[2];

}ble_slave_id_data_t;

typedef struct 
{
    uint8_t ble_state_last;
    uint8_t ble_state;    //主机蓝牙模块的状态
    uint8_t ble_num_last;
    uint8_t ble_num;    //正常连接的控制端个数
    uint8_t ble_time_out;
    ble_slave_id_data_t ble_slave_id_data[SLAVE_NUM_MAX];

}ble_receive_data_t;


void ble_receive_task_init(void);

#endif